home *** CD-ROM | disk | FTP | other *** search
/ Hot Super Models / Hot Super Models.iso / unix / x11 / xv2r1.tar / xv2r1 / extensions / xv / include / xvdix.h < prev    next >
C/C++ Source or Header  |  1991-08-29  |  6KB  |  238 lines

  1. /***********************************************************
  2. Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts,
  3. and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
  4.  
  5.                         All Rights Reserved
  6.  
  7. Permission to use, copy, modify, and distribute this software and its 
  8. documentation for any purpose and without fee is hereby granted, 
  9. provided that the above copyright notice appear in all copies and that
  10. both that copyright notice and this permission notice appear in 
  11. supporting documentation, and that the names of Digital or MIT not be
  12. used in advertising or publicity pertaining to distribution of the
  13. software without specific, written prior permission.  
  14.  
  15. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  16. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  17. DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  18. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  19. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  20. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  21. SOFTWARE.
  22.  
  23. ******************************************************************/
  24. #ifndef XVDIX_H
  25. #define XVDIX_H
  26. /*
  27. ** File: 
  28. **
  29. **   xvdix.h --- Xv device independent header file
  30. **
  31. ** Author: 
  32. **
  33. **   David Carver (Digital Workstation Engineering/Project Athena)
  34. **
  35. ** Revisions:
  36. **
  37. **   29.08.91 Carver
  38. **     - removed UnrealizeWindow wrapper unrealizing windows no longer 
  39. **       preempts video
  40. **
  41. **   11.06.91 Carver
  42. **     - changed SetPortControl to SetPortAttribute
  43. **     - changed GetPortControl to GetPortAttribute
  44. **     - changed QueryBestSize
  45. **
  46. **   15.05.91 Carver
  47. **     - version 2.0 upgrade
  48. **
  49. **   24.01.91 Carver
  50. **     - version 1.4 upgrade
  51. **
  52. */
  53.  
  54. #include "pixmap.h"
  55. #include "Xvproto.h"
  56.  
  57. #ifdef GLOBAL
  58. #define EXTERNAL
  59. #define INIT(i) = i
  60. #else GLOBAL
  61. #define EXTERNAL extern
  62. #define INIT(i)
  63. #endif
  64.  
  65. EXTERNAL int  XvScreenIndex;
  66. EXTERNAL unsigned long XvExtensionGeneration INIT(0);
  67. EXTERNAL unsigned long XvScreenGeneration INIT(0);
  68. EXTERNAL unsigned long XvResourceGeneration INIT(0);
  69.  
  70. EXTERNAL int XvReqCode;
  71. EXTERNAL int XvEventBase;
  72. EXTERNAL int XvErrorBase;
  73.  
  74. EXTERNAL unsigned long XvRTPort;
  75. EXTERNAL unsigned long XvRTEncoding;
  76. EXTERNAL unsigned long XvRTGrab;
  77. EXTERNAL unsigned long XvRTVideoNotify;
  78. EXTERNAL unsigned long XvRTVideoNotifyList;
  79. EXTERNAL unsigned long XvRTPortNotify;
  80.  
  81. typedef struct {
  82.   int numerator;
  83.   int denominator;
  84. } XvRationalRec, *XvRationalPtr;
  85.  
  86. typedef struct {
  87.   char depth;
  88.   unsigned long visual;
  89. } XvFormatRec, *XvFormatPtr;
  90.  
  91. typedef struct {
  92.   unsigned long id;
  93.   ClientPtr client;
  94. } XvGrabRec, *XvGrabPtr;
  95.  
  96. typedef struct _XvVideoNotifyRec {
  97.   struct _XvVideoNotifyRec *next;
  98.   ClientPtr client;
  99.   unsigned long id;
  100.   unsigned long mask;
  101. } XvVideoNotifyRec, *XvVideoNotifyPtr;
  102.  
  103. typedef struct _XvPortNotifyRec {
  104.   struct _XvPortNotifyRec *next;
  105.   ClientPtr client;
  106.   unsigned long id;
  107. } XvPortNotifyRec, *XvPortNotifyPtr;
  108.  
  109. typedef struct {
  110.   int id;
  111.   ScreenPtr pScreen;
  112.   char *name;
  113.   unsigned short width, height;
  114.   XvRationalRec rate;
  115. } XvEncodingRec, *XvEncodingPtr;
  116.  
  117. typedef struct {
  118.   unsigned long base_id;
  119.   unsigned char type; 
  120.   char *name;
  121.   int nEncodings;
  122.   XvEncodingPtr pEncodings;  
  123.   int nFormats;
  124.   XvFormatPtr pFormats;  
  125.   int nPorts;
  126.   struct _XvPortRec *pPorts;
  127.   ScreenPtr pScreen; 
  128.   int (* ddAllocatePort)();
  129.   int (* ddFreePort)();
  130.   int (* ddPutVideo)();
  131.   int (* ddPutStill)();
  132.   int (* ddGetVideo)();
  133.   int (* ddGetStill)();
  134.   int (* ddStopVideo)();
  135.   int (* ddSetPortAttribute)();
  136.   int (* ddGetPortAttribute)();
  137.   int (* ddQueryBestSize)();
  138.   DevUnion devPriv;
  139. } XvAdaptorRec, *XvAdaptorPtr;
  140.  
  141. typedef struct _XvPortRec {
  142.   unsigned long id;
  143.   XvAdaptorPtr pAdaptor;
  144.   XvPortNotifyPtr pNotify;
  145.   DrawablePtr pDraw;
  146.   ClientPtr client;
  147.   XvGrabRec grab;
  148.   TimeStamp time;
  149.   DevUnion devPriv;
  150. } XvPortRec, *XvPortPtr;
  151.  
  152. #define LOOKUP_PORT(_id, client)\
  153.      ((XvPortPtr)LookupIDByType(_id, XvRTPort))
  154.  
  155. #define LOOKUP_ENCODING(_id, client)\
  156.      ((XvEncodingPtr)LookupIDByType(_id, XvRTEncoding))
  157.  
  158. #define LOOKUP_VIDEONOTIFY_LIST(_id, client)\
  159.      ((XvVideoNotifyPtr)LookupIDByType(_id, XvRTVideoNotifyList))
  160.  
  161. #define LOOKUP_PORTNOTIFY_LIST(_id, client)\
  162.      ((XvPortNotifyPtr)LookupIDByType(_id, XvRTPortNotifyList))
  163.  
  164. typedef struct {
  165.   int version, revision;
  166.   int nAdaptors;
  167.   XvAdaptorPtr pAdaptors;
  168.   Bool (* DestroyWindow)();
  169.   Bool (* DestroyPixmap)();
  170.   Bool (* CloseScreen)();
  171.   Bool (* ddCloseScreen)();
  172.   int (* ddQueryAdaptors)();
  173.   DevUnion devPriv;
  174. } XvScreenRec, *XvScreenPtr;
  175.  
  176. #define SCREEN_PROLOGUE(pScreen, field)\
  177.   ((pScreen)->field = \
  178.    ((XvScreenPtr) \
  179.     (pScreen)->devPrivates[XvScreenIndex].ptr)->field)
  180.  
  181. #define SCREEN_EPILOGUE(pScreen, field, wrapper)\
  182.     ((pScreen)->field = wrapper)
  183.  
  184. /* Errors */
  185.  
  186. #define _XvBadPort (XvBadPort+XvErrorBase)
  187. #define _XvBadEncoding (XvBadEncoding+XvErrorBase)
  188.  
  189. extern int ProcXvDispatch();
  190. extern int SProcXvDispatch();
  191.  
  192. extern void XvExtensionInit();
  193. extern int XvScreenInit();
  194. extern Bool XvCloseScreen();
  195. extern Bool XvDestroyPixmap();
  196. extern Bool XvDestroyWindow();
  197. extern void XvResetProc();
  198.  
  199. extern int XvdiDestroyGrab();
  200. extern int XvdiDestroyEncoding();
  201. extern int XvdiDestroyVideoNotify();
  202. extern int XvdiDestroyPortNotify();
  203. extern int XvdiDestroyVideoNotifyList();
  204. extern int XvdiDestroyPort();
  205. extern int XvdiValidatePort();
  206. extern int XvdiSendVideoNotify();
  207. extern int XvdiSendPortNotify();
  208. extern int XvdiVideoStopped();
  209.  
  210. extern int XvdiPutVideo();
  211. extern int XvdiPutStill();
  212. extern int XvdiGetVideo();
  213. extern int XvdiGetStill();
  214. extern int XvdiSelectVideoNotify();
  215. extern int XvdiSelectPortNotify();
  216. extern int XvdiSetPortAttribute();
  217. extern int XvdiGetPortAttribute();
  218. extern int XvdiAbortVideo();
  219. extern int XvdiStopVideo();
  220. extern int XvdiPreemptVideo();
  221. extern int XvdiMatchPort();
  222.  
  223. #if defined(__STDC__) && !defined(UNIXCPP)
  224.  
  225. #define XVCALL(name) Xv##name
  226.  
  227. #else
  228.  
  229. #define XVCALL(name) Xv/**/name
  230.  
  231. #endif
  232.  
  233. #undef EXTERNAL
  234. #undef INIT
  235.  
  236. #endif XVDIX_H
  237.  
  238.